﻿<BadHabit_WPFTools:ShapedWindow
    x:Class="BadHabit.Factory.Windows.NewMaintanceProject"
    
    x:Name="window"
    
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    
    xmlns:props="clr-namespace:BadHabit.Factory.Properties"
    
    xmlns:BadHabit_WPFTools="clr-namespace:BadHabit.WPFTools;assembly=BadHabit.WPFTools"        
        
    Style="{StaticResource DialogWindow}"
    
    WindowStartupLocation="CenterOwner"
    
    Loaded="ShapedWindow_Loaded"
    
    Title="{x:Static props:Resources.Maintance_Project}"    
    Width="240"
    SizeToContent="Height"
    >
    
    <BadHabit_WPFTools:ShapedWindow.Resources>
        <x:Array x:Key="durationList" Type="{x:Type sys:Int32}">
            <sys:Int32>12</sys:Int32>
            <sys:Int32>24</sys:Int32>
            <sys:Int32>36</sys:Int32>        
        </x:Array>
    </BadHabit_WPFTools:ShapedWindow.Resources>


    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <TextBlock Grid.Row="0" Grid.ColumnSpan="2" Margin="2,2,2,6" TextWrapping="Wrap" Text="{x:Static props:Resources.New_Maintance_Project_explanation}"/>
            
        <TextBlock Grid.Row="1" Grid.Column="0" Text="{x:Static props:Resources.Starts_at}" Style="{StaticResource Label}"/>
        <TextBlock Grid.Row="2" Grid.Column="0" Text="{x:Static props:Resources.Duration}" Style="{StaticResource Label}"/>
        
        <TextBox x:Name="startDateTextBox"
                 Text="{Binding Path=Project[0].EstimatedStartDate, StringFormat='{}{0:d}'}"
                 Width="80"
                 HorizontalAlignment="Right"
                 TextAlignment="Right"
                 Grid.Row="1" Grid.Column="1" Style="{StaticResource FormTextBox}"/>

        <BadHabit_WPFTools:ComboBox
            x:Name="durationComboBox"
            SelectedValue="{Binding ElementName=window, Path=Duration}"
            Grid.Row="2" Grid.Column="1"
            HorizontalAlignment="Right"
            Style="{StaticResource FormComboBox}"
            ItemsSource="{StaticResource durationList }"
            >            
        </BadHabit_WPFTools:ComboBox>
            

    </Grid>
</BadHabit_WPFTools:ShapedWindow>
